{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "48469796",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'3.6.13 |Anaconda, Inc.| (default, Jun  4 2021, 14:25:59) \\n[GCC 7.5.0]'"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#环境\n",
    "#python=3.6\n",
    "\n",
    "import sys\n",
    "\n",
    "sys.version"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "7ced42f3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('1.10.1+cpu', '0.11.2+cpu', '0.10.1+cpu')"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#安装torch,简单起见,避免环境问题,并且计算量不大,使用cpu运行本套代码.\n",
    "#后面章节会介绍使用cuda计算的方法.\n",
    "\n",
    "#pip install torch==1.10.1+cpu torchvision==0.11.2+cpu torchaudio==0.10.1 -f https://download.pytorch.org/whl/cpu/torch_stable.html\n",
    "\n",
    "import torch\n",
    "import torchvision\n",
    "import torchaudio\n",
    "\n",
    "torch.__version__, torchvision.__version__, torchaudio.__version__"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "c01fc811",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'4.18.0'"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#安装transformers\n",
    "#pip安装\n",
    "#pip install transformers==4.18.0\n",
    "\n",
    "#conda安装(不推荐)\n",
    "#conda install -c huggingface transformers\n",
    "\n",
    "import transformers\n",
    "\n",
    "transformers.__version__"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "8e7adbd4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'2.4.0'"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#安装datasets\n",
    "#pip安装\n",
    "#pip install datasets==2.4.0\n",
    "\n",
    "#conda安装(不推荐)\n",
    "#conda install -c huggingface -c conda-forge datasets\n",
    "\n",
    "import datasets\n",
    "\n",
    "datasets.__version__"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "805c1c8d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'0.11.2'"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#安装torchtext\n",
    "#pip install torchtext==0.11.2\n",
    "\n",
    "import torchtext\n",
    "\n",
    "torchtext.__version__"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
